const express = require('express');
const router = express.Router();
const tokenMiddleware = require('../middleware/tokenMiddleware');

// router.use(tokenMiddleware);
const { register, login, logOut, getUserInfo, getAllContacts, setAvatar } = require('../controllers/userController');

router.post("/register", register)
router.post("/login", login)
router.post("/logout", logOut)
router.get("/userInfo", tokenMiddleware, getUserInfo)
router.get("/contacts", tokenMiddleware, getAllContacts)
router.post("/setAvatar", tokenMiddleware, setAvatar)
// router.post("/refresh")
module.exports = router;